Skip to content

Conversation

@ecPablo
Copy link
Contributor

@ecPablo ecPablo commented Jan 14, 2026

We are moving some of the helpers to load inspectors and converters from mcms-tools since these functions are also used in some of the composite actions in CLD and we don't want to inject new repo dependencies. This change will allow us to load inspectors for getting on chain opcounts in tools we are building to update all domain opcounts in proposals. Not doing this would require to have copies of these functions which are chain family dependant, making it harder to add new chain families. Thus, I opted to move it to a single place where it can easily be imported as a library to keep new chain integrations more streamlined.

AI Summary

This pull request introduces new helpers for working with MCMS chain client loaders, specifically adding inspector and converter utilities to the chainlink-deployments-framework. These helpers make it easier to build and fetch chain-specific inspectors and converters for timelock proposals, and include robust unit tests for the new logic. Additionally, the PR updates configuration and dependency files to support these additions.

The most important changes are:

Inspector and Converter Helpers:

  • Added inspectors.go and converters.go in experimental/proposalutils to provide generic helpers for building and fetching chain-specific inspectors and converters for MCMS timelock proposals. These helpers support EVM, Solana, and Aptos chains, and handle chain selector family detection. [1] [2]
  • Introduced the InspectorFetcher interface and its implementation, MCMInspectorFetcher, for fetching inspectors based on chain metadata and action.

Chain Metadata Utilities:

  • Added aptos_helpers.go and sui_helpers.go in experimental/proposalutils/chainsmetadata to provide utility functions for extracting roles and metadata from MCMS timelock proposals for Aptos and Sui chains. [1] [2]

Testing:

  • Comprehensive unit tests for the new helpers and utilities were added in inspectors_test.go, converters.go (indirectly tested via inspectors), chainsmetadata/aptos_helpers_test.go, and chainsmetadata/sui_helpers_test.go. [1] [2] [3]

Mocks and Configuration:

  • Added a MockInspectorFetcher for testing, and updated .mockery.yml to generate mocks for the new interface. [1] [2]

Changelog and Dependency:

  • Added a changeset entry documenting the new helpers.
  • Updated go.mod to explicitly require github.com/samber/lo.

@changeset-bot
Copy link

changeset-bot bot commented Jan 14, 2026

🦋 Changeset detected

Latest commit: 0d71bda

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
chainlink-deployments-framework Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@ecPablo ecPablo marked this pull request as ready for review January 14, 2026 15:45
@ecPablo ecPablo requested a review from a team as a code owner January 14, 2026 15:45
Copilot AI review requested due to automatic review settings January 14, 2026 15:45
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

converter = &evm.TimelockConverter{}
case chainsel.FamilySolana:
converter = solana.TimelockConverter{}
case chainsel.FamilyAptos:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aren't we missing a few chains here? Like Sui?

Copy link
Contributor

@gustavogama-cll gustavogama-cll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, I love that you're trying to reduce the duplication we have right now but I feels we could give this a bit more thought. In particular, I think most of these function (maybe all) could go in the mcms library itself, no CLDF's experimental package...

I see the inspectors part could be a bit more challenge as there's a dependency on CLDF's Blockchains object, but maybe that's precisely what we need to figure out: how to define an interface in the mcms library that is implemented by cldf's Blockchains.

If you like the idea and are willing to wait a couple of hours, I can try to run a few local tests to see how that would look like.

@ecPablo
Copy link
Contributor Author

ecPablo commented Jan 14, 2026

So, I love that you're trying to reduce the duplication we have right now but I feels we could give this a bit more thought. In particular, I think most of these function (maybe all) could go in the mcms library itself, no CLDF's experimental package...

I see the inspectors part could be a bit more challenge as there's a dependency on CLDF's Blockchains object, but maybe that's precisely what we need to figure out: how to define an interface in the mcms library that is implemented by cldf's Blockchains.

If you like the idea and are willing to wait a couple of hours, I can try to run a few local tests to see how that would look like.

Yeah I'm all for it, having it mcmslib would be great. Sure lets explore this one a bit more, I think it's worth taking a bit more time to fix these things the proper way.

Copilot AI review requested due to automatic review settings January 14, 2026 16:35
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

var converter sdk.TimelockConverter
switch fam {
case chainsel.FamilyEVM:
converter = &evm.TimelockConverter{}
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Inconsistent converter instantiation: EVM uses pointer while Solana (line 29) uses value type. Consider making the pattern consistent across all chain families.

Copilot uses AI. Check for mistakes.
@cl-sonarqube-production
Copy link

Quality Gate failed Quality Gate failed

Failed conditions
66.1% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube

@gustavogama-cll
Copy link
Contributor

If you like the idea and are willing to wait a couple of hours, I can try to run a few local tests to see how that would look like.

Here's my attempt at implementing this in mcms lib. There's a comment about a change we'd need in CLDF.

@ecPablo
Copy link
Contributor Author

ecPablo commented Jan 14, 2026

nice looking good! I'll close this one, I was trying a similar approach smartcontractkit/mcms#579 which was a lot of similarities to yours

@ecPablo ecPablo closed this Jan 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants